package com.example.administrator.kotlin.fragment

import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v7.widget.LinearLayoutManager
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.example.administrator.kotlin.R
import kotlinx.android.synthetic.main.fragment_news.*

/**
 * Created by Administrator on 2018/2/27/027.
 */
class MeizhiFragment : Fragment() {
    companion object {
        fun newInstance(): MeizhiFragment {
            return MeizhiFragment()
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

    }

    override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater?.inflate(R.layout.fragment_news, container, false)
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        initData()
        recyclerview.layoutManager = LinearLayoutManager(activity)
//        var adapter = NewsAdapter(R.layout.item_text,initData(), activity)
    }

    private fun initData(): ArrayList<String> {
        val arrayList = ArrayList<String>()
        for (iten in 1..10) {
            arrayList.add("item :" + iten)
        }
        return arrayList
    }
}